<div class="title">
  发放情况
</div>
<div class="body">
  <div class="project">
    <dl>
      <dt>
          <%= link_to_function '待发',"projects_by_pay_status('paying')", :class => 'paying_money' %>：
      </dt>
      <dd><%= Project.sum(:paying_stages_count) %>个</dd>
      <dd class="m"><b>￥</b><%= number_with_precision Project.sum(:paying_total_amount), :precision => 1 %></dd>
    </dl>
    <dl>
      <dt>
         <%= link_to_function '暂缓',"projects_by_pay_status('paused')", :class => 'paused_money' %>：
      </dt>
      <dd><%= Project.sum(:paused_stages_count) %>个</dd>
      <dd class="m"><b>￥</b><%= number_with_precision Project.sum(:paused_total_amount), :precision => 1 %></dd>
    </dl>
    <dl>
      <dt>
        <%= link_to_function '已发',"projects_by_pay_status('payed')", :class => 'payed_money' %>：
      </dt>
      <dd><%= Project.sum(:payed_stages_count) %>个</dd>
      <dd class="m"><b>￥</b><%= number_with_precision Project.sum(:payed_total_amount), :precision => 1 %></dd>
    <% Project.stat_by_payed_on.each do |stat| %>
      <dd class='year'>
          <dl>
            <dt><%= link_to_function "#{stat.year}年","payed_projects_by_payed_year(#{stat.year})", :title => '发放年' %></dt>
            <dd><%= stat.projects_count %>个</dd>
            <dd class='m'><b>￥</b><%= number_with_precision stat.payed_total_amount, :precision => 1 %></dd>
          </dl>
       </dd>
    <% end %>
    </dl>
  </div>
</div>
<div class="total">
  <dl>
    <dt>
      <%= link_to_remote '共计',
                :update => :projects,
                :url => projects_url ,
                :method => :get,
                :loading => short_loader('projects', :height => 500, :width => 725)
        %>：
    </dt>
    <dd><%= Project.sum('paying_stages_count + paused_stages_count + payed_stages_count') %>个</dd>
    <dd class="m"><b>￥</b><%= number_with_precision Project.sum('paused_total_amount + payed_total_amount + paying_total_amount'), :precision => 1 %></dd>
  </dl>
</div>

